<?php slot('body-bg', '/uploads/images/regions/background/'.$ktd_region->getBackground()) ?>
<?php slot('body-repeat', 'no-repeat')?>
<?php slot('body-bg-head', NULL) ?>
<?php slot('body-bg-foot', NULL) ?>

<div id="region">
    <div class="lf">
    <div class="cat"><img style="vertical-align: top" src="/images/mgen/icon/pastille.png"/><h1><?php echo $ktd_region->getName() ?></h1></div>
    <?php if($sf_user->hasActualCharacter() && $sf_user->hasPermission('create_adventure')): ?>
        <a class="btn primary" href="<?php echo url_for("new_adventure", $ktd_region); ?>">En route pour l'aventure !</a>
    <?php endif; ?>
    <?php if(!count($ktd_adventures)): ?>
        <span class="italic">Le calme plat... Aucune aventure !</span>
    <?php endif; ?>
    <?php include_partial('pagination', array('pager' => $pager, 'ktd_region' => $ktd_region)) ?>
        <!-- On fait défiler les aventures ! -->
        <div style="margin-top: 5px;">
        <?php foreach($ktd_adventures as $ktd_adventure): ?>
        <div class="topic-list-cadre">
            <div class="topic-list-cadre-sprite lf <?php echo $ktd_adventure->isNew() ? 'new' : 'old' ?>" title="<?php echo $ktd_adventure->isNew() ? 'Nouveau' : 'Ancien' ?>"></div>
                <div class="rg">
                    <div class="topic-list-cadre-sprite display" style="background-position: -116% 72%; ">
                        <div class="topic-list-cadre-sprite rg">
                            <div class="span-7 "><?php echo link_to($ktd_adventure->getTitle(), 'show_adventure', $ktd_adventure); ?>
                                                 <br/>
                                                 <span style="font-size: xx-small">Lancée par <?php echo link_to($ktd_adventure->getFirstAction()->getKTDCharacter()->getPseudo(), "show_character", $ktd_adventure->getFirstAction()->getKTDCharacter()) ?> le <?php echo $ktd_adventure->getFirstAction()->getCreatedAt() ?> </span>
                                                </div>

                            <div class="span-3" style="font-size: x-small"><?php echo link_to("Dernière action", "show_last_adventure_action", $ktd_adventure) ?><br/>
                                <span style="font-size: xx-small">par <?php echo link_to($ktd_adventure->getFirstAction()->getKTDCharacter()->getPseudo(), "show_character", $ktd_adventure->getLastAction()->getKTDCharacter()) ?></span></div>
                        </div>
                        <div class="topic-list-cadre-sprite lf" style="background-position: 98% 72%">
                        </div>
                    </div>
                    <div class="topic-list-cadre-sprite bottom"></div>
                </div>
        </div>
        <?php endforeach; ?>
        </div>
        <!-- C'est fini T_T -->
    <?php include_partial('pagination', array('pager' => $pager, 'ktd_region' => $ktd_region)) ?>
    </div>
    <div class="gentv rg">
        <div class="foxy-coal">
            <div class="under-tv">
                <div class="news-bubble">
                    <div class="news">
                        <?php if($ktd_region->getLastAction() != NULL): ?>
                        <h6>Dernières activités</h6>
                        Le dernier écho nous vient de <?php echo link_to($ktd_region->getLastAction()->getKTDCharacter()->getPseudo(), "show_character", $ktd_region->getLastAction()->getKTDCharacter()) ?> pour <?php echo $ktd_region->getLastAction()->getKTDAdventure()->getTitle() ?>
                        <br/>
                        <?php endif; ?>
                        <h6>En quelques mots :</h6>
                        <p class="italic">
                                <?php echo KillTheDragon::shortenText($ktd_region->getDescription(), 200); ?><br/>
                                <?php echo link_to("En savoir plus ?", 'show_region_infos', $ktd_region) ?>
                        </p>
                        <br/>
                        Gen News toujours à la pointe de l'information !
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>